<{include file="section/admin/header2.tpl"}>

<div class="box02">
            <div class="box02_1">
                <div class="search02 clear">
                   	<div><a href="/orders/status/wait_verify">未确认</a> | <a href="/orders/status/unpaid">已确认</a> | <a href="/orders/status/confirm_free">已免单</a></div>
                </div>

				<div class="table01">
	            	<table cellpadding="0" cellspacing="0" width="100%" border="0" id="table">
		                <tr class="th">
		                    <th><div class="tl">订单号</div></th>
							<th><div>店铺</div></th>
		                    <th><div>商品</div></th>
							<th><div>单价</div></th>
							<th><div>数量</div></th>
							<th><div>总价</div></th>
		                    <th><div>订单状态</div></th>
		                </tr>
		                
					<{foreach from=$list key=key item=item}>
					
						<tr>
							<td><{$item.order_id}></td>
							<td><a href="<{php}> echo Shop::shop_detail_url($this->_tpl_vars['item']['shop_id']);<{/php}>" target="_blank"><{php}>echo Shop::name($this->_tpl_vars['item']['shop_id']);<{/php}></a></td>
							<td>装修网店铺<{$item.title}></td>
							<td>原价：<{$item.price}>元/年</td>
							<td><{$item.count}></td>
							<td><{$item.amount_real}>元/年</td>
							<td><{$item.status}></td>
						</tr>
						
					<{if $item.status_v == 'wait_verify'}>	
						<tr>
							<td colspan="7" style="text-align:left;">
								<br/>
								代理公司：<input type="text" value="" name="pc" />&nbsp;&nbsp;
								销售代表：<input type="text" value="" name="sr" />&nbsp;&nbsp;<a href="javascript:void(0);" action-type="order_verify" action-data="order_id=<{$item.order_id}>&type=normal">确认</a><br/><br/>
								批 准 人：<input type="text" value="朱大晖" name="ap" />&nbsp;&nbsp;<a href="javascript:void(0);" action-type="order_free" action-data="order_id=<{$item.order_id}>&type=free">免单</a>
								<br/><br/>
							</td>
						</tr>
					<{/if}>
					<{/foreach}>
	                </table>
                    </div>
				
                <div class="box02_lab clear">
                	共计：<{$total}> &nbsp; <{$pagination}>
                </div>
            </div>
            
</div>
<script type="text/javascript">
jQuery(function($) {
	//table("表格名称","默认背景""鼠标经过背景","最后一行鼠标经过背景");
	//table("table","bg","bg1","bg2");

	function test(e){
		var msg = {'verify':'你确定"确认"此单吗？','free':'你确定"免单"此单吗？'},
			data = $(this).attr('action-data');	
		if(!confirm(msg[e.data.type])) return false;

		// get param
		$(this).parent().find('input').each(function(){
			data += '&'+$(this).attr('name')+'='+$(this).val();
		});
		
		$.ajax({
			url: '/orders/status_verify',
			type : 'POST',
			data : data+'&'+new Date().getTime(),
			dataType : 'json',
			success: function(s){
			   	if(s.status == '100000' || s.status == '110000'){
					alert(s.msg);
					window.location.reload(true);
				}else{
					alert(s.msg);
				}
			},
			error: function(){
				alert('系统错误，请稍后再试');
			}
		});
	}
	
	$("a[action-type='order_verify']").bind('click',{'type':'verify'},test);
	
	$("a[action-type='order_free']").bind('click',{'type':'free'},test);
});
</script>
<{include file="section/admin/footer2.tpl"}>
